package 字符串.easy;

import java.util.Arrays;

/**
 * @author Lw中
 * @date 2020/8/25 10:21
 */
public class Mst0102 {

    public static boolean CheckPermutation(String s1, String s2) {
        if (s1.length() != s2.length()) {
            return false;
        }
        char[] chars = s1.toCharArray();
        char[] chars1 = s2.toCharArray();
        // 对字符数组排序
        Arrays.sort(chars);
        Arrays.sort(chars1);
        return Arrays.equals(chars, chars1);
    }

    public static void main(String[] args) {
        boolean b = CheckPermutation("abc", "bac");
        System.out.println(b);
    }

}
